package com.power.sifa.supervise.model;

import com.plf.core.common.annotations.FieldEnumText;
import com.plf.core.common.domain.BaseModel;
import com.power.sifa.approve.model.enumeration.Tp_applysource;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
*  复议监督主表实体类
*/

@Entity
@ApiModel(value="复议监督主表")
@Data
@Table(name="Apl_supervise",schema="sfapprove")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@IdClass(Apl_supervise.Apl_supervisePK.class) 用于复合组件
public class Apl_supervise extends BaseModel implements Serializable {

	private static final long serialVersionUID = 1L;

    @Id
    @Setter(AccessLevel.NONE)
    @ApiModelProperty(value = "applyid")
    private String id;

    @ApiModelProperty(value = "申请人")
    private String applyname;

    @ApiModelProperty(value = "被申请人")
    private String targetname;

    @ApiModelProperty(value = "被申请人的行政区划")
    private String targetadid;

    @ApiModelProperty(value = "事项信息")
    private String matinfo;

    @ApiModelProperty(value = "事实依据")
    private String facbasis;

    @ApiModelProperty(value = "决定类型")
    private Integer decisiontype;

    @ApiModelProperty(value = "是否需要整改")
    private Integer isrectifica;

    @ApiModelProperty(value = "案件承办人id")
    private String firstid;

    @ApiModelProperty(value = "案件承办人name")
    private String firstname;

    @ApiModelProperty(value = "案件协办人id")
    private String secondid;

    @ApiModelProperty(value = "案件协办人name")
    private String secondname;

    @ApiModelProperty(value = "反馈截止日期")
    private String enddate;

    @ApiModelProperty(value = "案件承办部门")
    private String departid;


    @ApiModelProperty(value = "复议监督子流程状态")
    private Integer sonstatus;

    @ApiModelProperty(value = "审查赣政通待办id")
    private String reviewtodoid;

    @ApiModelProperty(value = "整改赣政通代办id")
    private String rectifitodoid;


    @ApiModelProperty(value = "案件辅助人id")
    private String thirdid;

    @ApiModelProperty(value = "案件辅助人name")
    private String thirdname;


    /**
     *  是否整改完成
     *  {@link com.plf.common.domain.YesNo }
     */
    @ApiModelProperty(value = "是否整改完成")
    private Integer isfinish;

    /**
     * 申请流水号
     */
    @Transient
    private String applycode;

    /**
     * 行政复议录入人
     */
    @Transient
    private String regusername;

    /**
     *  行政复议创建时间
     */
    @Transient
    private String createtime;

    /**
     *  案件号
     */
    @Transient
    private String acceptcode;

    /**
     *  applyid
     */
    @Transient
    private String applyid;

    /**
     *  instid
     */
    @Transient
    private String instid;

    /**
     *  来源
     *  {@link Tp_applysource }
     */
    @Transient
    private Integer source;

    /**
     *  是否需要整改文本
     */
    @Transient
    @FieldEnumText(eum="Tp_applysource", valuefield="source")
    private String source_text;



    /**
     *  状态
     *  {@link com.power.sifa.approve.model.enumeration.St_apply }
     */
    @Transient
    private Integer status;

    /**
     *  决定类型文本
     */
    @Transient
    @FieldEnumText(eum="Tp_supervise_decision", valuefield="decisiontype")
    private String decisiontype_text;

    /**
     *  是否需要整改文本
     */
    @Transient
    @FieldEnumText(eum="Tp_yesno", valuefield="isrectifica")
    private String isrectifica_text;



    /**
     *  复议监督子流程状态文本
     */
    @Transient
    @FieldEnumText(eum="St_admreviewson", valuefield="sonstatus")
    private String sonstatus_text;

    /**
     *  是否整改完成文本
     */
    @Transient
    @FieldEnumText(eum="Tp_yesno", valuefield="isfinish")
    private String isfinish_text;




    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("applyname", this.getApplyname());
        map.put("targetname", this.getTargetname());
        map.put("targetadid", this.getTargetadid());
        map.put("matinfo", this.getMatinfo());
        map.put("facbasis", this.getFacbasis());
        map.put("decisiontype_text", this.decisiontype_text);
        map.put("decisiontype", this.getDecisiontype());
        map.put("isrectifica_text", this.isrectifica_text);
        map.put("isrectifica", this.getIsrectifica());
        map.put("firstid", this.getFirstid());
        map.put("firstname", this.getFirstname());
        map.put("secondid", this.getSecondid());
        map.put("secondname", this.getSecondname());
        map.put("enddate", this.getEnddate());
        map.put("departid", this.getDepartid());
        map.put("sonstatus_text", this.sonstatus_text);
        map.put("sonstatus", this.getSonstatus());
        map.put("reviewtodoid", this.getReviewtodoid());
        map.put("rectifitodoid", this.getRectifitodoid());
        return map;
    }

    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Apl_supervisePK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String)key;

        //Apl_supervisePK pk = (Apl_supervisePK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}
